<?php
class sscls_IndexController extends sscls_Controller
{
    
    function __construct()
    {
        $this->view='index';
    }
    
    function view()
    {
		$model=$this->getModel();
		$vals['articles']=$model->getArticles(14);
		$vals['item']=$model->getArticle(29);
		$this->layout='index';
        $this->view='index';
        $this->display($vals);   
        return true;
        
    }
    
    function plogin()
    {                                
        $username=sscls_Request::getRequest('username');
        $password=sscls_Request::getRequest('password');
        $status=sscls_User::login($username,$password);
        if($status['suc'])
        {
            $this->redirec('index.php?c=agenda',$status['msg']);
        }
        else
        {
            $this->redirec('index.php?c=user&t=login',$status['msg'],'error');
        }
        return true;
    }
    
    function logout()
    {
        sscls_User::logout();
        $this->redirec('index.php?c=user&t=login');
    }
}
 
?>
